<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="SDP(Session Description Protocol)，即会话描述协议，为会话通知、会话邀请和其它形式的多媒体会话初始化等目的提供了多媒体会话描述，在rfc2327中定义。  SDP至少需要包含: 会话名称及意图 会话有效时间 媒体流信息（类型、地址、端口、格式等）    协议格式 协议以key=value形式 v=0 o=102 2048 497 IN IP4 192.168.0.1">
<meta property="og:type" content="article">
<meta property="og:title" content="SDP协议解读">
<meta property="og:url" content="http://smallmuou.gitee.io/blog/2014/11/14/2014-11-14-sdp协议解读/index.html">
<meta property="og:site_name" content="smallmuou&#39;s blog">
<meta property="og:description" content="SDP(Session Description Protocol)，即会话描述协议，为会话通知、会话邀请和其它形式的多媒体会话初始化等目的提供了多媒体会话描述，在rfc2327中定义。  SDP至少需要包含: 会话名称及意图 会话有效时间 媒体流信息（类型、地址、端口、格式等）    协议格式 协议以key=value形式 v=0 o=102 2048 497 IN IP4 192.168.0.1">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2020-04-16T01:15:21.841Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="SDP协议解读">
<meta name="twitter:description" content="SDP(Session Description Protocol)，即会话描述协议，为会话通知、会话邀请和其它形式的多媒体会话初始化等目的提供了多媒体会话描述，在rfc2327中定义。  SDP至少需要包含: 会话名称及意图 会话有效时间 媒体流信息（类型、地址、端口、格式等）    协议格式 协议以key=value形式 v=0 o=102 2048 497 IN IP4 192.168.0.1">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://smallmuou.gitee.io/blog/2014/11/14/2014-11-14-sdp协议解读/"/>





  <title>SDP协议解读 | smallmuou's blog</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">smallmuou's blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"><a href="https://github.com/smallmuou">https://github.com/smallmuou</a></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/blog/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/blog/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2014/11/14/2014-11-14-sdp协议解读/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">SDP协议解读</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2014-11-14T00:00:00+08:00">
                2014-11-14
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/音视频/" itemprop="url" rel="index">
                    <span itemprop="name">音视频</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>SDP(Session Description Protocol)，即会话描述协议，为会话通知、会话邀请和其它形式的多媒体会话初始化等目的提供了<code>多媒体会话描述</code>，在rfc2327中定义。</p>
<ul>
<li>SDP至少需要包含:<ul>
<li>会话名称及意图</li>
<li>会话有效时间</li>
<li>媒体流信息（类型、地址、端口、格式等）</li>
</ul>
</li>
</ul>
<h2 id="协议格式"><a href="#协议格式" class="headerlink" title="协议格式"></a><a href="http://www.ietf.org/rfc/rfc2327.txt" target="_blank" rel="noopener">协议格式</a></h2><ul>
<li>协议以key=value形式<pre>
v=0
o=102 2048 497 IN IP4 192.168.0.104
s=Talk
c=IN IP4 192.168.0.104
b=AS:380
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7076 RTP/AVP 120 111 110 0 8 101
a=rtpmap:120 SILK/16000
a=rtpmap:111 speex/16000
a=fmtp:111 vbr=on
a=rtpmap:110 speex/8000
a=fmtp:110 vbr=on
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
</pre>

</li>
</ul>
<h2 id="keys-包含Session，Time，Media"><a href="#keys-包含Session，Time，Media" class="headerlink" title="keys 包含Session，Time，Media"></a>keys 包含Session，Time，Media</h2><h4 id="Session-description"><a href="#Session-description" class="headerlink" title="Session description"></a>Session description</h4><ul>
<li>v=  (protocol version)<ul>
<li>没有次版本</li>
</ul>
</li>
<li>o=  (owner/creator and session identifier).<ul>
<li>o=username session-id version network—type address-type address<ul>
<li>“IN” = Internet</li>
<li>“IP4” = ipv4</li>
</ul>
</li>
</ul>
</li>
<li>s=  (session name)</li>
<li>i=* (session information)</li>
<li>u=* (URI of description)</li>
<li>e=* (email address)</li>
<li>p=* (phone number)</li>
<li>c=* (connection information - not required if included in all media)<ul>
<li>c=network-type address-type connection-address</li>
</ul>
</li>
<li>b=* (bandwidth information)<ul>
<li>b=modifier:bandwidth-value(kpb/s)</li>
</ul>
</li>
<li>One or more time descriptions (see below)</li>
<li>z=* (time zone adjustments)</li>
<li>k=* (encryption key)</li>
<li>a=* (zero or more session attribute lines)<ul>
<li>a=attribute:value …</li>
</ul>
</li>
<li>Zero or more media descriptions (see below)<h4 id="Time-description"><a href="#Time-description" class="headerlink" title="Time description"></a>Time description</h4></li>
<li>t=  (time the session is active)<ul>
<li>t=start-time stop-time, 若为0 0，则视为永久会话</li>
</ul>
</li>
<li>r=* (zero or more repeat times)<ul>
<li>r=repeat-interval active-duration list-of-offsets-from-start-time<h4 id="Media-description"><a href="#Media-description" class="headerlink" title="Media description"></a>Media description</h4></li>
</ul>
</li>
<li>m=  (media name and transport address)<ul>
<li>m=media port transport fmt-list</li>
<li>a=rtpmap:payload-type encoding-name/clock-rate[/encoding-parameters]</li>
</ul>
</li>
<li>i=* (media title)</li>
<li>c=* (connection information - optional if included at session-level)</li>
<li>b=* (bandwidth information)</li>
<li>k=* (encryption key)</li>
<li>a=* (zero or more media attribute lines)</li>
</ul>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/2014/11/07/2014-11-07-asterisk在macosx下编译/" rel="next" title="Asterisk 技术点">
                <i class="fa fa-chevron-left"></i> Asterisk 技术点
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/2014/11/14/2014-11-14-iOS设备配置/" rel="prev" title="iOS 设备配置">
                iOS 设备配置 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">smallmuou</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">197</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/blog/categories/index.html">
                  <span class="site-state-item-count">12</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/smallmuou" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-globe"></i>GitHub</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#协议格式"><span class="nav-number">1.</span> <span class="nav-text">协议格式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#keys-包含Session，Time，Media"><span class="nav-number">2.</span> <span class="nav-text">keys 包含Session，Time，Media</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Session-description"><span class="nav-number">2.0.1.</span> <span class="nav-text">Session description</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Time-description"><span class="nav-number">2.0.2.</span> <span class="nav-text">Time description</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Media-description"><span class="nav-number">2.0.3.</span> <span class="nav-text">Media description</span></a></li></ol></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">smallmuou</span>

  
</div>

    <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

    <span id="busuanzi_container_site_pv">总访问量<span id="busuanzi_value_site_pv"></span>次</span>
    <span class="post-meta-divider">|</span>



  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
